import request from '@/common/request.js';

//获取意见反馈类型
export function getFacebookCategoryData(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/getFacebookCategoryList',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//保存意见反馈
export function saveFacebook(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/saveFacebook',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//获取拨打号码 -- 测试
export function getCallTaskBlack(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/getCallTaskBlack',
		method: 'post',
		loading: true,
        timeout:2000,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//修改任务状态
export function updateCallTask(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/Index/updateCallTask',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//上传通话录音文件
export function handleUploadVoice(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/Appdownload/uploadVoice',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//保存通话信息
export function saveCallOutDataNoVoice(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/saveCallOutDataNoVoice',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//添加通话信息
export function addCallOutDataNoVoice(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/addCallOutDataNoVoice',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//添加通话信息--2025-10-22
export function addCallOutDataNoVoicePro(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/addCallOutDataNoVoicePro',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//推送第三方接口
export function pushCbUrlData(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/Index/pushCbUrlData',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//获取手机录音服务列表
export function getVoiceServiceList(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/getVoiceServiceList',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//获取所有分类列表
export function getAllCategory(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/getAllCategory',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//获取指定的省，市，县数据
export function getCityList(params) {
	let baseApiUrl = uni.getStorageSync("baseApiUrl");
	let base_url = 'http://' + baseApiUrl + '/';
	
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/getCityList',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//获取拨打号码 -- 测试
export function getCallTaskBlackNew(params) {
	return request.httpRequest({
		url: 'api/AppIndexNew/getCallTaskBlackNew',
		method: 'post',
		loading: true,
        timeout:2000,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//单条验证是否为黑名单
export function isBlackByNumber(params) {
    let baseApiUrl = uni.getStorageSync("baseApiUrl");
    let base_url = 'http://' + baseApiUrl + '/';
    
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/isBlackByNumber',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//获取手机录音的操作说明
export function getHelpData(params) {
    let baseApiUrl = uni.getStorageSync("baseApiUrl");
    let base_url = 'http://' + baseApiUrl + '/';
    
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/getHelpData',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}

//上传图片到服务器进行OCR识别
export function uploadImgToOCR(params) {
    let baseApiUrl = uni.getStorageSync("baseApiUrl");
    let base_url = 'http://' + baseApiUrl + '/';
    
	return request.httpRequest({
		url: base_url + 'api/AppIndexNew/uploadImgToOCR',
		method: 'post',
		loading: true,
		requestHeader: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	}, params);
}
